<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改点位</title>
    <style>
        .wu-pos-a {
            box-sizing: border-box;
            padding-top: 39px;
            width: 20%;
            left: auto;
            right: 0;
        }

        .wu-inline>.form-group{
            margin-right:0;
            margin-left:0;
        }
    </style>
</head>
<body>
<div class="pos-r">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        点位管理
        <span class="c-gray en">&gt;</span>
        点位管理
        <span class="c-gray en">&gt;</span>
        修改点位
    </nav>
    <!--<div class="pos-a wu-pos-a">-->
        <!--<div class="wu-tree">点位可服务项目</div>-->
        <!--<div class="wu-treeBox">-->
            <!--<ul id="editStoreServiceTree" class="ztree"></ul>-->
        <!--</div>-->
    <!--</div>-->

    <div>
        <div class="page-container">
            <form action="" method="post" class="form form-horizontal" id="store-form-member-edit">
                <input type="text" class="form-control" value="" style="display: none;" id="store-edit-shopId" name="shopId">
                <input type="text" class="form-control" value="" style="display: none;" id="store-edit-array" name="array">
                <div class="form-unit">基本信息</div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>点位名称：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-shopName" name="shopName">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>设备ID：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-boxUid" name="boxUid">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>设备编号：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-boxNo" name="boxNo">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>点位地址：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-shopAddr" name="shopAddr">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>洗车价格一：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-price" name="price">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格一模式名称：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceMode" name="priceMode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格一模式介绍：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceRemark" name="priceRemark">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>洗车价格二：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceTwo" name="priceTwo">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格二模式名称：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceTwoMode" name="priceTwoMode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格二模式介绍：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceTwoRemark" name="priceTwoRemark">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>洗车价格三：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceThree" name="priceThree">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格三模式名称：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceThreeMode" name="priceThreeMode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>价格三模式介绍：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-priceThreeRemark" name="priceThreeRemark">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>标准编码：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="向山西中石化推送时填写，否则直接不填" id="store-edit-oucode" name="oucode">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>商户编码：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="向山西中石化推送时填写，否则直接不填" id="store-edit-mchcode" name="mchcode">
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>充值一：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pOne" name="pOne">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>赠送一：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pGiveOne" name="pGiveOne">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>充值二：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pTwo" name="pTwo">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>赠送二：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pGiveTwo" name="pGiveTwo">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>充值三：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pThree" name="pThree">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>赠送三：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pGiveThree" name="pGiveThree">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>充值四：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pFour" name="pFour">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>赠送四：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <input type="text" class="form-control" value="" placeholder="从上到下，依次填写" id="store-edit-pGiveFour" name="pGiveFour">
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>所属企业：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        <select class="form-control" name="id" id="store-edit-subMchName">
                        </select>
                    </div>
                </div>
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>点位电话1：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-shopPhone1" name="shopPhone1">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>点位电话2：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<input type="text" class="form-control" value="" placeholder="" id="store-edit-shopPhone2" name="shopPhone2">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>点位电话3：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<input type="text" class="form-control" value="" placeholder="" id="store-edit-shopPhone3" name="shopPhone3">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="form-unit">配置信息</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>开始营业时间：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<input type="text" class="form-control input-text Wdate" onfocus="WdatePicker({readOnly:true,dateFmt: 'HH:mm'})" id="store-edit-startTime" name="startTime">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>结束营业时间：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<input type="text" class="form-control input-text Wdate" onfocus="WdatePicker({readOnly:true,dateFmt: 'HH:mm'})" id="store-edit-endTime" name="endTime">-->
                    <!--</div>-->
                <!--</div>-->
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>获取经纬度：</label>
                    <div class="formControls col-xs-8 col-sm-9">
                        <div class="form-inline wu-inline">
                            <button type="button" class="btn btn-primary" id="showEditMap"  data-toggle="modal" data-target=".modal-map-edit">显示地图</button>
                            <div class="form-group">
                                <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-longitude" name="longitude">
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-latitude" name="latitude">
                            </div>
                        </div>
                    </div>
                </div><!--
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>经度：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        &lt;!&ndash;<input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-longitude" name="longitude">&ndash;&gt;
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-4 col-sm-3"><span class="c-red"></span>纬度：</label>
                    <div class="formControls col-xs-4 col-sm-4">
                        &lt;!&ndash;<input type="text" class="form-control" value="" placeholder="必填项" id="store-edit-latitude" name="latitude">&ndash;&gt;
                    </div>
                </div>-->
                <!--<div class="form-unit">其他信息</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3">点位描述：</label>-->
                    <!--<div class="formControls col-xs-4 col-sm-4">-->
                        <!--<textarea id="store-edit-shopDesc" name="shopDesc" cols="60" rows="5" class="textarea valid" placeholder="请输入点位的描述..."></textarea>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="form-group">-->
                    <!--<label class="control-label col-xs-4 col-sm-3">图片上传：</label>-->
                    <!--<div class="formControls col-xs-8 col-sm-8">-->
                        <!--<div class="uploader-list-container">-->
                            <!--<input id="editShopImg" name="file[]" multiple type="file" class="file-loading"/>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
                <div class="form-group">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                        <input onclick="merchantStoreManageEditFun.submitAction();return false;" class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"/>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<!--地图模态框-->
<div class="modal fade modal-map-edit" tabindex="-1" role="dialog" id="mapModalLabelEdit">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <input type="text" id="wordEdit">
            <button id="searchWordEdit">搜索</button>
            <div id="wuTestMapEdit" style="min-height: 700px;width: 100%"></div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //点位管理，添加服务
    var merchantStoreManageEditFun;

    merchantStoreManageEditFun = {
        map : new BMap.Map("wuTestMapEdit"),
        init: function () {
            let _this = this;

            //加载门店名称
            $.ajax({
                type: "GET",
                url: "biz/getWxBizShopMchDtoList",
                dataType: "json",
                async:false,
                success: function (data) {
                    for(var i = 0;i<data.data.length;i++){
                        $("#store-edit-subMchName").append("<option value='"+data.data[i].id+"'>"+data.data[i].text+"</option>");
                    }
                },
                error: function () {
                    alert("error");
                }
            });

//            _this.serviceType();
            var shopId = sessionStorage.getItem("manage-shopId");
            _this.modify(shopId);
            _this.bootstrapvalidatorForm();
            _this.loadMap();
        },
        loadMap : function () {
            /*******************加载地图**********/
            let _this = this;
            _this.map.centerAndZoom("太仓",13);
            _this.map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
            _this.map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
            //单击获取点击的经纬度
            _this.loadPoint($("#store-edit-longitude").val(),$("#store-edit-latitude").val());
            var local = new BMap.LocalSearch( _this.map, {
                renderOptions:{map:   _this.map}
            });
            $('#searchWordEdit').on('click',function(){
                var val = $('#wordEdit').val();
                local.search(val);
            })
            _this.map.addEventListener("click",function(e){
                _this.map.clearOverlays();
                $("#store-edit-longitude").val(e.point.lng);
                $("#store-edit-latitude").val(e.point.lat);
                _this.loadPoint(e.point.lng,e.point.lat);
                $('#mapModalLabelEdit').modal('hide');
            });
        },
        loadPoint : function (lng,lat) {
            let _this = this;
            var point = new BMap.Point(lng,lat);
            _this.map.centerAndZoom(point, 13);
            var marker = new BMap.Marker(point);  // 创建标注
            _this.map.addOverlay(marker);               // 将标注添加到地图中
            marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
        },
        modify: function (index) {
            var _this = this;
            $.ajax({
                type: "get",
                url: "biz/getShopByShopId",
                async: false,
                data: {shopId: index},
                dataType: "json",
                success: function (result) {
                    if (result.state) {
                        var data = result.data;
                        $("#store-edit-shopName").val(data.shopName);
                        $("#store-edit-boxUid").val(data.boxUid);
                        $("#store-edit-boxNo").val(data.boxNo);
                        $("#store-edit-shopAddr").val(data.shopAddr);
                        $("#store-edit-price").val(data.price/100);
                        $("#store-edit-priceMode").val(data.priceMode);
                        $("#store-edit-priceRemark").val(data.priceRemark);
                        $("#store-edit-priceTwo").val(data.priceTwo/100);
                        $("#store-edit-priceTwoMode").val(data.priceTwoMode);
                        $("#store-edit-priceTwoRemark").val(data.priceTwoRemark);
                        $("#store-edit-priceThree").val(data.priceThree/100);
                        $("#store-edit-priceThreeMode").val(data.priceThreeMode);
                        $("#store-edit-priceThreeRemark").val(data.priceThreeRemark);
                        $("#store-edit-longitude").val(data.longitude);
                        $("#store-edit-latitude").val(data.latitude);
                        $("#store-edit-shopId").val(data.shopId);
                        $("#store-edit-oucode").val(data.oucode);
                        $("#store-edit-mchcode").val(data.mchcode);
                        $("#store-edit-pOne").val(data.pOne/100);
                        $("#store-edit-pGiveOne").val(data.pGiveOne/100);
                        $("#store-edit-pTwo").val(data.pTwo/100);
                        $("#store-edit-pGiveTwo").val(data.pGiveTwo/100);
                        $("#store-edit-pThree").val(data.pThree/100);
                        $("#store-edit-pGiveThree").val(data.pGiveThree/100);
                        $("#store-edit-pFour").val(data.pFour/100);
                        $("#store-edit-pGiveFour").val(data.pGiveFour/100);
                        $("option[value="+data.id+"]").attr("selected",true);
//                        var biz_type = data.bizType;
//                        $("#edit-type-" + (biz_type + 1)).prop("checked", true);
//                        var state = data.bizState;
//                        $("#edit-state-" + (state + 1)).prop("checked", true);
//                        var ddd = $("#edit-sysUserIds").select2();    //获取selectid
//                        ddd.val(data.sysUserId).trigger("change");    //设置 value 为four的 option 为选中状态
//                        var ddds = $("#edit-roleIds").select2();    //获取selectid
//                        ddds.val(data.roleId).trigger("change");    //设置 value 为four的 option 为选中状态
//
//                        var resList = data.imgList;
//                        if (resList != null) {
//                            var urlList = [];
//                            for (var i = 0; i < resList.length; i++) {
//                                urlList.push("files"+resList[i]["url"]);
//                            }
//                            $("#editShopImg").fileinput({
//                                language: "zh", //设置语言
//                                uploadUrl: "file/upload", //上传的地址
//                                allowedFileExtensions: ["jpg", "png", "gif"],//接收的文件后缀
//                                maxFileCount: 5,
//                                showUpload: false,//是否显示上传按钮
//                                showRemove: false,//是否显示删除按钮
//                                showCaption: true,//是否显示输入框
//                                browseClass: "btn btn-primary", //按钮样式
//                                enctype: "multipart/form-data",
//                                showPreview: true,
//                                uploadAsync: false,//多图片一次上传
//                                maxSize: 1024,//单位kb
//                                allowedPreviewTypes: ["image"],
//                                uploadExtraData: function () {
//                                    return extData;
//                                },
//                                initialPreview: urlList,
//                                initialPreviewAsData: true,
//                                //deleteUrl: "file/upload",
//                                overwriteInitial: false,
//                                maxFileSize: 100
//                            }).on("change", function (event) {
//                                isChange = true;
//                            });
//                        }

                    }
                    else {
                        alert(result.message);
                    }
                },
                error: function () {
                    alert("error");
                }
            });
//            _this.loadTreeChecked(index);
        },
        //表单提交
        submitAction: function () {
            //bootstrap验证
            var bootstrapValidator = $("#store-form-member-edit").data('bootstrapValidator');
            bootstrapValidator.validate();
            if(bootstrapValidator.isValid())
                $("#store-form-member-edit").submit();
            else return;

//            //开始营业时间
//            var startTime = $("#store-edit-startTime").val();
//            if (startTime == null || startTime == undefined || startTime == "") {
//                layer.alert("开始营业时间不能为空！", {icon: 0});
//                return false;
//            }
//            //结束营业时间
//            var endTime = $("#store-edit-endTime").val();
//            if (endTime == null || endTime == undefined || endTime == "") {
//                layer.alert("结束营业时间不能为空！", {icon: 0});
//                return false;
//            }
//
//            var zTreeTemp = $.fn.zTree.getZTreeObj("editStoreServiceTree");
//            var nodesTemp = zTreeTemp.getCheckedNodes(true);//在提交表单之前将选中的checkbox收集
//            if(nodesTemp.length == 0){
//                layer.alert("请选择至少一个服务项目！", {icon: 0});
//                return false;
//            }
//
//            var treeObj = $.fn.zTree.getZTreeObj("editStoreServiceTree");
//            var nodes = treeObj.getCheckedNodes(true);//在提交表单之前将选中的checkbox收集
//            var array = new Array();
//            for (var i = 0; i < nodes.length; i++) {
//                array.push(nodes[i].id);
//            }
//            $("#store-edit-array").val(array);

            //提交
            $.ajax({
                type: "GET",
                url: "biz/modifyBizShop",
                data: $("#store-form-member-edit").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.state) {
//                        if (isChange) {//有图片上传的
//                            extData = {"typeId": "shop_id", "relateId": $("#store-edit-shopId").val()};
//                            $("#editShopImg").fileinput("upload");
//                        }
//                        layer.msg(data.message, {icon: 1});
                        //关闭新增窗口
                        removeIframe();
                        merchantStoreManageFun.searchAction();
                    } else {
                        $("#store-edit-usernameSpan").text(data.message);
                    }
                },
                error: function () {
                    alert("error");
                }
            });
        },
        //加载右侧可选择的服务树
//        serviceType: function () {
//            $.ajax({
//                type: "get",
//                url: "biz/getServicePackageTree",
//                async: false,
//                dataType: "json",
//                success: function (data) {
//                    if(data.state){
//                        var merchantAddSetting = {
//                            check: {
//                                enable: true
//                            },
//                            data: {
//                                simpleData: {
//                                    enable: true
//                                }
//                            }
//                        };
//                        $.fn.zTree.init($("#editStoreServiceTree"), merchantAddSetting, data.data);
//                        var treeObj = $.fn.zTree.getZTreeObj("editStoreServiceTree");
//                        treeObj.expandAll(true);
//
//                    }
//
//                },
//                error: function () {
//                    alert("error");
//                }
//            });
//        },
        //加载右侧树选中节点
//        loadTreeChecked: function (index) {
//            $.ajax({
//                type: "GET",
//                url: "biz/getShopServiceType?shopId=" + index,
//                dataType: "json",
//                success: function (data) {
//                    if(data.state){
//                        //首先取消所有选中状态
//                        var treeObj = $.fn.zTree.getZTreeObj("editStoreServiceTree");
//                        treeObj.checkAllNodes(false);
//                        treeObj.cancelSelectedNode();
//
//                        //获取所有节点的信息data
//                        for (var i = 0; i < data.data.length; i++) {
//                            var zTree = $.fn.zTree.getZTreeObj("editStoreServiceTree");
//                            var node = zTree.getNodeByParam("id", data.data[i].servicePackageId);
//                            node.checked = true;
//                            //设置选中之后，需要更新一次，否则无法选中该节点
//                            zTree.updateNode(node);
//                        }
//                    }else {
//                        layer.msg("加载失败！", {icon: 2});
//                        return false;
//                    }
//
//                },
//                error: function () {
//                    alert("error");
//                }
//            });
//        },
        //bootstrap验证
        bootstrapvalidatorForm: function () {
            $('#store-form-member-edit').bootstrapValidator({
                message: 'This value is not valid',
                excluded : [':disabled'],
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
                    shopName: {
                        validators: {
                            notEmpty: {
                                message: '点位名称不能为空'
                            },
                            stringLength: {
                                min: 2,
                                max: 100,
                                message: '点位名称长度必须在2到100位之间'
                            }
                        }
                    },
                    unid: {
                        validators: {
                            notEmpty: {
                                message: '设备编号不能为空'
                            },
                            stringLength: {
                                min: 2,
                                max: 20,
                                message: '设备编号长度必须在2到20位之间'
                            }
                        }
                    },
                    shopAddr: {
                        validators: {
                            notEmpty: {
                                message: '点位地址不能为空'
                            },
                            stringLength: {
                                min: 2,
                                max: 200,
                                message: '点位地址长度必须在2到200位之间'
                            }
                        }
                    },
                    longitude: {
                        validators: {
                            notEmpty: {
                                message: '经度不能为空'
                            },
                            regexp: {
                                regexp: /^-?((0|[1-9]\d?|1[1-7]\d)(\.\d{1,6})?|180(\.0{1,6})?)?$/,
                                message: '经度格式不正确'
                            }
                        }
                    },
                    latitude: {
                        validators: {
                            notEmpty: {
                                message: '纬度不能为空'
                            },
                            regexp: {
                                regexp: /^-?((0|[1-8]\d?)(\.\d{1,6})?|90(\.0{1,6})?)?$/,
                                message: '纬度格式不正确'
                            }
                        }
                    }
                }
            });
        }
    };

//    var extData;
//    var isChange;

    merchantStoreManageEditFun.init();
</script>
</body>
</html>